const {
  Sequelize,
  Model
} = require('sequelize')

const {
  sequelize
} = require('../config/db');

class privateMsg extends Model {

}

privateMsg.init({
  id: {
    type: Sequelize.INTEGER,
    primaryKey: true,
    autoIncrement: true
  },
  sender:{
    type: Sequelize.STRING,
    allowNull: false,
    comment: '发送者'
  },
  receiver:{
    type: Sequelize.STRING,
    allowNull: false,
    comment: '接收者'
  },
  message:{
    type: Sequelize.STRING,
    allowNull: false,
    comment: '消息'
  },
  type:{
    type: Sequelize.STRING,
    allowNull: true,
    comment: '消息类型'
  },
}, {
  sequelize,
  modelName: 'privateMsg',
  tableName: 'privateMsg'
})

// privateMsg.sync({
//   force: true
// })

module.exports = privateMsg